import request from '@/api/request'

export interface RegisterData {
    username: string
    email: string
}

export async function registerApi(data: { 
    username: string
    email: string
    password: string
    captchaId?: string
    captchaCode?: string
}) {
    return request<any>({
        url: '/auth/register',
        method: 'POST',
        data
    })
}

// 如果不再需要验证码和重置密码，可以注释或删除
// export async function sendVerificationCodeApi(data: { email: string,purpose:string }) {
//     return request<null>({
//         url: '/auth/verification-code',
//         method: 'POST',
//         skipAuth:true,
//         data
//     })
// }

// export async function validateCodeApi(data: { email: string, code: string, purpose: string, verificationToken?: string }) {
//     console.log('验证验证码API:', data)
//     return request<null>({
//         url: '/auth/verification-code/validate',
//         method: 'POST',
//         data
//     })
// }

// export async function resetPasswordApi(data: { email: string; verificationCode: string; newPassword: string }) {
//     return request<null>({
//         url: '/auth/reset-password',
//         method: 'POST',
//         skipAuth: true,
//         data
//     })
// }
